<!DOCTYPE html>
<html lang="<?php echo ($lang_url==''? 'es': substr($lang_url, 0, 2)); ?>">
<head>
  <meta charset="utf-8" />

  <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame 
       Remove this if you use the .htaccess -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

  <title><?php echo lang('v_wait_loading'); ?></title>

  <meta name="robots" content="noindex" />
  <meta name="viewport" content="width=device-width; initial-scale=1.0" />
  <style media="screen" type="text/css">
  	body {
		font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
		margin: 60px 0 0 0;
		padding: 0;
		background-color: rgba(0,0,0, 0.8);
	}
  	.absoluto{
  		width:630px;
  		margin:40px auto;
  		text-align: center;
  	}
  	.absoluto #countdown{
  		background-color:#FFFFFF;
  		color:#DB4B39;
  		font-size:3em;
  		padding: 10px;
		-moz-border-radius: 	10px;
		-webkit-border-radius: 	10px;
		border-radius: 			10px;
	}
	.aviso{
		color: #F0F0F0;
	}
	
  	.centerss{
  		width:470px;
  		margin:10px auto 0 auto;
  	}
  </style>
 <?php
	if(isset($this->carabiner)){
		$this->carabiner->display('css');
		$this->carabiner->display('js');
	}
?>
<script type="text/javascript">
	var base_url = "<?php echo Sys::$url_base; ?>",
	lang_url = "<?php echo $lang_url; ?>";
</script>
</head>

<body>
<div id="all-content">
	<div id="header">
		<header>
			<a href="<?php echo base_url($lang_url).($lang_url!=''? '/': ''); ?>" class="llogo">
				<img src="<?php echo base_url().'application/images/pelimaniaco-logo.png'; ?>" class="logo" width="159" height="68" alt="<?php echo Sys::$title_web; ?>" />
			</a>
			<span class="txt_beta">Beta</span>
			
			<nav class="menu">
				<ul>
					<li class="no-border"><a href="<?php echo base_url($lang_url).($lang_url!=''? '/': ''); ?>" class="home"><?php echo lang('v_home'); ?></a></li>
					<li><a href="<?php echo base_url($lang_url.'films').'/'; ?>" class="films"><?php echo lang('v_films'); ?></a></li>
					<li><a href="<?php echo base_url($lang_url.'series').'/'; ?>" class="series"><?php echo lang('v_series'); ?></a></li>
				</ul>
			</nav>
			
			<div class="flags_lang">
			<?php
				$les = ' sel';
				$len = ' sel';
				if($lang == 'spa')
					$len = '';
				else
					$les = '';
			?>
				<a href="<?php echo base_url('chlang~spa'); ?>" class="ch_lang<?php echo $les; ?>">Español</a> | 
				<a href="<?php echo base_url('chlang~eng'); ?>" class="ch_lang<?php echo $len; ?>">English</a>
			</div>
			
			<div class="login_user">
		<?php
		if(isset($usr_info)){
		?>
				<span class="info_user btn-gray corner-all8">
					<span><img src="<?php echo $usr_info['url_foto']; ?>" class="no-margin" width="20" height="20" />
					<?php echo $usr_info['nombre']; ?> </span> | 
					<a href="<?php echo base_url($lang_url.'panel/'); ?>" title="Panel" class="panel"></a> | 
					<a href="<?php echo base_url('services/user/logout?lang_url='.$lang) ?>" title="<?php echo lang('v_logout'); ?>" class="salir"></a>
				</span>
		<?php
		}else{
		?>
				<a id="btn-login" class="btn btn-green corner-all"><?php echo lang('v_login'); ?></a>
				<div id="box-login" class="box-login">
					<span class="pico"></span>
					<div class="title">
						<span class="title float-l"><?php echo lang('v_access'); ?></span>
						<span id="box-close" class="close float-r"></span>
						<div class="clear"></div>
					</div>
					
					<form action="" method="post" class="frm1" id="frm-login">
						<input type="email" id="int-email" name="email" class="size90" placeholder="<?php echo lang('v_email'); ?>" />
						<input type="password" name="password" class="size90" placeholder="*******" />
						<div id="res_login"></div>
						<input type="submit" name="login" class="btn-blue corner-all float-r" value="<?php echo lang('v_accessed'); ?>" />
						<div class="clear"></div>
					</form>
					
					<a href="<?php echo base_url('services/facebook/sigin?lang='.$lang); ?>" class="acces-facebook"><?php echo lang('v_access_facebook'); ?></a>
					<img src="<?php echo base_url('application/images/loader.gif'); ?>" class="loader-face" width="220" height="19" />
				</div>
				<a href="<?php echo base_url($lang_url.'create_account'); ?>/" class="btn btn-blue corner-all"><?php echo lang('v_register'); ?></a>
		<?php
		} 
		?>
			</div>
			<div class="clear"></div>
		</header>
	</div>
	<div class="absoluto">
		<span id="countdown">59</span>
		<p class="aviso"><?php echo lang('v_wait_loading'); ?></p>
	<div>
		
	<div class="centerss"><!-- Publicidad -->
		<iframe frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="468" height="60" SRC="http://ad.adnetwork.net/st?ad_type=iframe&ad_size=468x60&section=2709725" ></iframe>
	</div>
</div>

<?php
if(isset($link)){
	$location = base_url('player/view/?link='.urlencode($link).'&video='.$video.'&t='.$t);
} 
?>
<?php 
if(isset($premium))
	$count = 4;
echo '<script>
var seconds = '.$count.';
setInterval(
function(){
if (seconds <= 0) {
window.location = "'.$location.'";
}
else {
document.getElementById("countdown").innerHTML = --seconds;
}
},
1000
);
</script>'; ?>
</body>
</html>
